<?php

class Core_Controller_Admin_Settings_General extends Controller
{
    protected $_script = 'module/core/views/admin/settings/general/edit.tpl';

    public function indexAction()
    {
        $this -> setScript(null);
    }

    public function siteAction()
    {
        $this -> form = $form = Nuo::getForm('core@admin.settings.general.site');

        $request = $this -> getRequest();

        if ($request -> isPost() and $form -> isValid($request -> getPost()))
        {
            $form -> doCommit();
        }
    }

    public function cacheAction()
    {
        $this -> form = $form = Nuo::getForm('core@admin.settings.general.cache');

        $request = $this -> getRequest();

        if ($request -> isPost() and $form -> isValid($request -> getPost()))
        {
            $form -> doCommit();
        }
    }

    public function mailAction()
    {
        $this -> form = $form = Nuo::getForm('core@admin.settings.general.mail');

        $request = $this -> getRequest();

        if ($request -> isPost() and $form -> isValid($request -> getPost()))
        {
            $form -> doCommit();
        }
    }

    public function stageAction()
    {
        $this -> form = $form = Nuo::getForm('core@admin.settings.general.stage');

        $request = $this -> getRequest();

        if ($request -> isPost() and $form -> isValid($request -> getPost()))
        {
            $form -> doCommit();
        }
    }

    public function speedAction()
    {
        $this -> form = $form = Nuo::getForm('core@admin.settings.general.speed');

        $request = $this -> getRequest();

        if ($request -> isPost() and $form -> isValid($request -> getPost()))
        {
            $form -> doCommit();
        }
    }

    public function signupAction()
    {
        // Nuo::getHelper('core@mail') -> send('core@test-email', 1);
    }

}
